# -*- coding: UTF-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import Select
import time,json,requests,threading


driver = webdriver.Firefox()
vivo = webdriver.Firefox()
mg = webdriver.Firefox()
# rmrb = webdriver.Firefox()
xq = webdriver.Firefox()
ks = webdriver.Firefox()
toutiao = webdriver.Firefox()

driver.get('https://www.liepin.com/login?backUrl=https%3A%2F%2Fwww.liepin.com%2Fcity-hz%2Fzpdaoyoua%2F')

vivo.get('https://passport.vivo.com/#/login?client_id=30&redirect_uri=https%3A%2F%2Fwww.vivo.com%2F')

mg.get('https://www.mgtv.com/')

# rmrb.get('http://stcn.com/')

xq.get('https://xueqiu.com/?md5__1038=QqGxcDnDyiitnD05o4%2Br%3DWYG%3D%3DqD5w%2BNdx')

ks.get('https://www.kuaishou.com/new-reco')

toutiao.get('https://www.toutiao.com/?wid=1737598434023')

mobile=15200324938

time.sleep(60)
	


def a():
	while(True):
		try:
			boss=driver.find_element(By.CSS_SELECTOR,".form-item-wrap.clearfix.form-item-verycode .valid-item-warp .violet-btn.violet-btn-primary.violet-btn-medium.btn-phone-code.form-item-left-line span")
			boss.click()
		except Exception as e:
			print("error1")
		time.sleep(70)

def b():
	while(True):
		try:
			v=vivo.find_element(By.CSS_SELECTOR,".get-code-pc.ellipsis .get span")
			v.click()
		except Exception as e:
			print("error2")
		time.sleep(70)

def c():
	while(True):
		try:
			mgtv=mg.find_element(By.CSS_SELECTOR,".send-code")
			mgtv.click()
		except Exception as e:
			print("error3")
		time.sleep(70)

# def d():
# 	while(True):
# 		try:
# 			rm=rmrb.find_element(By.CSS_SELECTOR,".login-send-phone-code-btn.send-phone-code-btn")
# 			rm.click()
# 		except Exception as e:
# 			print("error4")
# 		time.sleep(70)
	
def e():
	while(True):
		try:
			xqs=xq.find_element(By.CSS_SELECTOR,".newLogin_form-group-addon_XmE .newLogin_send-code_-fb.newLogin_active_2CK")
			xqs.click()
		except Exception as e:
			print("error5")
		time.sleep(70)
	
def f():
	while(True):
		try:
			ksh=ks.find_element(By.CSS_SELECTOR,".get-verification.has-phone")
			ksh.click()
		except Exception as e:
			print("error6")
		time.sleep(70)
def g():
	while(True):
		try:
			tou=toutiao.find_element(By.CSS_SELECTOR,".web-login .web-login-button-input__button-text.send-input")
			tou.click()
		except Exception as e:
			print("error7")

if __name__ == '__main__':
	# while(True):
	# 	a()
	# 	b()
	# 	c()
	# 	d()
	# 	e()
	# 	f()

	thread1=threading.Thread(target=a)
	thread2=threading.Thread(target=b)
	thread3=threading.Thread(target=c)
	# thread4=threading.Thread(target=d)
	thread5=threading.Thread(target=e)
	thread6=threading.Thread(target=f)
	
	thread1.start()
	thread2.start()
	thread3.start()
	# thread4.start()
	thread5.start()
	thread6.start()

	thread1.join()
	thread2.join()
	thread3.join()
	# thread4.join()
	thread5.join()
	thread6.join()

		
